﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="HistoricoConsultas.aspx.cs" Inherits=" RzCorportativo.Views.Consulta.HistoricoConsultas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
        Histórico de consultas
    </h1>
    <hr />
    <table border="0" cellpadding="0" cellspacing="" style="width: 100%">
        <tr>
            <td class="field">
                Paciente:
            </td>
            <td class="field2">
                <asp:TextBox runat="server" ID="Nome" />
            </td>
            <td class="field">
                CPF:
            </td>
            <td class="field2">
                <asp:TextBox runat="server" ID="CPF" mask="cpf" />
            </td>
        </tr>
        <tr>
            <td class="field">
                Medico:
            </td>
            <td class="field2">
                <asp:TextBox runat="server" ID="NomeMedico" />
            </td>
            <td class="field">
                Especialidade:
            </td>
            <td class="field2">
                <asp:DropDownList runat="server" ID="Especialidade" Width="250">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="field">
                Data:
            </td>
            <td class="field2">
                <asp:TextBox runat="server" ID="Data" date="true" mask="calendar" />
            </td>
            <td class="field">
                Status:
            </td>
            <td class="field2">
                <asp:DropDownList runat="server" ID="Status" Width="250">
                    <asp:ListItem Text="Selecione" Value="0" Selected="True" />
                    <asp:ListItem Text="Atendida" Value="1" />
                    <asp:ListItem Text="Não Atedida" Value="2" />
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="field">
                Hora de Entrada:
            </td>
            <td class="field2">
                <asp:TextBox runat="server" ID="txtHrI" clock="true" />
            </td>
            <td class="field">
                Hora de Saída:
            </td>
            <td class="field2">
                <asp:TextBox runat="server" ID="txtHrS" clock="true" />
            </td>
        </tr>
    </table>
    <br />
    <asp:Button Text="buscar" ID="buscar" runat="server" OnClick="buscar_Click" CssClass="btn"/>
    <div style="min-width: 800px; margin-top: 30px" class="grid">
        <asp:GridView runat="server" AutoGenerateColumns="false" ID="ListaConsulta" AlternatingRowStyle-CssClass="gridrow_alternate"
            RowStyle-CssClass="gridrow" CssClass="table-hover" 
            PageSize="5" AllowPaging="true" OnPageIndexChanging="ListaConsulta_PageIndexChanging">
            <EmptyDataTemplate>
                <strong>Não foram encontrados médicos para os filtros selecionados</strong>
            </EmptyDataTemplate>
            <Columns>
                <asp:BoundField DataField="DateConsulta" HeaderText="Data" DataFormatString="{0: dd/MM/yyyy}" />
                <asp:BoundField DataField="HoraEntrada" HeaderText="Entrada" DataFormatString="{0:T}" />
                <asp:BoundField DataField="HoraSaida" HeaderText="Saída" DataFormatString="{0:T}" />
                <asp:TemplateField HeaderText="Paciente">
                    <ItemTemplate>
                        <%# this.GetItem(Container.DataItem).Paciente.Nome%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Medico">
                    <ItemTemplate>
                        <%# this.GetItem(Container.DataItem).Medico.Pessoa.Nome%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Status">
                    <ItemTemplate>                    
                        <a href="<%#EFramework.Web.UrlBase.UrlPadrao + "DetalhesConsulta?consulta=" + this.GetItem(Container.DataItem).ConsultaId.ToString()%>">Detalhes</a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>